package server.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import server.domain.Courier;
import server.mapper.CourierMapper;

@Service
public class CourierService {
	@Autowired
	private CourierMapper mapper;
	
	public boolean delBatch(Integer[] ids) {
		if(ids==null||ids.length==0)
			return false;
		int rs=mapper.delBatch(ids);
		return rs== 0 ? false : true;
	}

	public List<Courier> findPage(int start,int size){
		return mapper.findPage(start,size);
	}

	public int getCount() {
		return mapper.getCount();
	}

	public boolean delete(int id) {
		int rs=mapper.cancel(id);
		return rs==0 ? false : true;
		
	}

	public boolean update(Courier c) {
		int rs = mapper.updateByPrimaryKey(c);
		
		return rs==0 ? false : true;
	}

	public boolean add(Courier c) {
		int rs=mapper.insert(c);
		return rs==0 ? false : true;
	}

}
